<?php
namespace app\gateway\controller;

use think\facade\Config;
use Workerman\Worker;
use GatewayWorker\Register;

class Startregister{

	public function __construct(){
        //gateway配置参数
        $gateway_config = Config::get('gateway.');
		// register 服务必须是text协议
		$register = new Register($gateway_config['register_text']);
		
		// 如果不是在根目录启动，则运行runAll方法
		if(!defined('GLOBAL_START'))
		{
			Worker::runAll();
		}
	}
}
